home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 June / 1986-06.d64 / autoboot maker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  88 lines

  1. 100 print"[147]name of program to load":inputpn$
  2. 110 input "name of boot program";bn$
  3. 120 input "location to jump after load";loc$
  4. 130 if loc$="" then basic=1:goto 160
  5. 140 if left$(loc$,1)="$" then gosub 760:goto 160
  6. 150 loc=val(loc$)
  7. 160 input "kill runstop/restore (y/n)";rn$
  8. 170 rn$=left$(rn$,1)
  9. 180 if not (rn$="y" or rn$="n") then 160
  10. 190 open 15,8,15,"i"
  11. 200 open 8,8,8,"0:"+bn$+",p,w"
  12. 210 print#8,chr$(167)chr$(02);
  13. 220 print#8,chr$(len(pn$));
  14. 230 print#8,pn$;
  15. 240 if rn$="n" then 380
  16. 250 for c=1 to 17
  17. 260 read code
  18. 270 print#8,chr$(code);
  19. 280 next c
  20. 290 data 120         : rem sei
  21. 300 data 169,052     : rem lda #52
  22. 310 data 141,020,003 : rem sta $0314
  23. 320 data 169,134     : rem lda #134
  24. 330 data 141,024,003 : rem sta $0318
  25. 340 data 169,234     : rem lda #234
  26. 350 data 141,025,003 : rem sta $0319
  27. 360 data 088         : rem cli
  28. 370 goto 390
  29. 380 for c=1 to 17:read code:next c
  30. 390 for c=1 to 38
  31. 400 read code
  32. 410 print#8,chr$(code);
  33. 420 next c
  34. 430 data 169,002     :rem lda #2
  35. 440 data 162,008     :rem ldx #8
  36. 450 data 160,255     :rem ldy #255
  37. 460 data 032,186,255 :rem jsr $ffba
  38. 470 data 173,167,002 :rem lda $02a7
  39. 480 data 162,168     :rem ldx #$a8
  40. 490 data 160,002     :rem ldy #$02
  41. 500 data 032,189,255 :rem jsr $ffbd
  42. 510 data 169,000     :rem lda #$00
  43. 520 data 032,213,255 :rem jsr $ffd5
  44. 530 data 169,131     :rem lda #131
  45. 540 data 141,002,003 :rem sta $0302
  46. 550 data 169,164     :rem lda #164
  47. 560 data 141,003,003 :rem sta $0303
  48. 570 data 134,045     :rem stx $2d
  49. 580 data 132,046     :rem sty $2e
  50. 590 if basic=1 then gosub 860:goto 620
  51. 600 l1=int(loc/256):l2=loc-(l1*256)
  52. 610 print#8,chr$(76)chr$(l2)chr$(l1);
  53. 620 if rn$="y" then bu=58+len(pn$)+1
  54. 630 if rn$="n" then bu=41+len(pn$)+1
  55. 640 if basic=1 then bu=bu+11
  56. 650 bl=88-bu
  57. 660 for c=1 to bl+1:print#8,chr$(0);:next c
  58. 670 print#8,chr$(139)chr$(227);
  59. 680 b=679+len(pn$)+1
  60. 690 l1=int(b/256):l2=b-(l1*256)
  61. 700 print#8,chr$(l2)chr$(l1);
  62. 710 close8
  63. 720 get#15,a$:s=st
  64. 730 print a$;
  65. 740 if s=0 then 720
  66. 750 end
  67. 760 l=len(loc$)
  68. 770 s=l-1
  69. 780 for c=1 to l
  70. 790 i$=mid$(loc$,c,1)
  71. 800 if i$<="9" then i$=str$(val(i$))
  72. 810 if i$=>"a" then i$=str$(asc(i$)-55)
  73. 820 loc=loc+val(i$)*16^s
  74. 830 s=s-1
  75. 840 next c
  76. 850 return
  77. 860 for c=1 to 14
  78. 870 read code
  79. 880 print#8,chr$(code);
  80. 890 next c
  81. 900 data 169,000     :rem lda #$00
  82. 910 data 133,122     :rem sta $7a
  83. 920 data 169,008     :rem lda #$08
  84. 930 data 133,123     :rem sta $78
  85. 940 data 032,096,166 :rem jsr $a660
  86. 950 data 076,174,167 :rem jmp $a7ae
  87. 960 return
  88.